package exploit

import (
	"github.com/Xyntax/CDK/pkg/lib"
	"github.com/Xyntax/CDK/pkg/probe"
	"log"
)

// plugin interface
type ServiceProbeS struct{}

func (p ServiceProbeS) Desc() string {
	return "scan subnet to find Docker/K8s inner services, usage: cdk run service-probe 192.168.1.0-255"
}
func (p ServiceProbeS) Run() bool {
	// if your script needs input, parse os.Args by yourself.
	args := lib.Args["<args>"].([]string)
	if len(args) != 1 {
		log.Println("Invalid input args")
		log.Fatal(p.Desc())
	}
	probe.TCPScanExploitAPI(args[0])
	return true
}

func init() {
	plugin := ServiceProbeS{}
	lib.Register("service-probe", plugin)
}
